package com.eight.paper.admin.domain.model.enums;

import java.util.HashMap;
import java.util.Map;


public enum GradeStatusEnum {

    未答卷("1", "未答卷"),
    已答未阅卷("2", "已答未阅卷"),
    已阅卷("3", "已阅卷");

    String code;
    String name;

    GradeStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }


    private static final Map<String, GradeStatusEnum> keyMap = new HashMap<>();

    static {
        for (GradeStatusEnum item : GradeStatusEnum.values()) {
            keyMap.put(item.getCode(), item);
        }
    }

    public static GradeStatusEnum fromCode(String code) {
        return keyMap.get(code);
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
